<div class="table-bordered border-left">
  <div class="top-title-container text-article-info">
    共收到<%= @received_messages.count %>条留言
    <%= will_paginate @received_messages %>
  </div>
  <% if @received_messages.any? then %>
    <% @received_messages.each do |message| %>
      <table class="border-bottom" style="width: 100%;">
        <tr>
          <td rowspan="2" class="padding10" style="width: 58px; vertical-align: top; border: 0;">
            <%= link_to add_cdn_path(image_tag 'portrait.gif', class: 'thumbnail portrait'), user_path(message.from_user) %>
          </td>
          <td style="padding: 10px 10px 0 0; border: 0;">
            <%= link_to "@#{message.from_user.name}", user_path(message.from_user) %>：
            <br/>
            <%= message.details.html_safe %>
           </td>
        </tr>
        <tr>
          <td class="text-article-info" style="padding: 2px 10px 5px 0; border: 0;">
            <%= message.created_at_from_now %>
            <span class="pull-right">
              <%= link_to '回复', new_user_message_path(message.from_user, message) %>
              <%= link_to_function '回复', "popup('#{new_user_message_path(message.from_user, message)}')" %>
              <%= link_to t('common.delete_btn_label'), user_message_path(current_user, message), method: :delete, data: {confirm: t('common.alert.delete')} %>
            </span>
          </td>
        </tr>
      </table>
    <% end %>

    <div class="bottom-title-container text-article-info">
      共收到<%= @received_messages.count %>条留言
      <%= will_paginate @received_messages %>
    </div>
  <% end %>
</div>

